def fun(a, b=10):
    print('a=', a)
    print('b=', b)


# 定义可变参数
def fun2(*args):
    print('args=', args)
    pass


# 定义可变参数关键字形参
def fun3(**args):
    print(args)


fun(20)
fun2('10', '20')
dic = {'a': 10, 'b': 20, 'c': 30}
fun3(**dic)


# 设置必须采用关键字传递
def fun4(a, b, *, c, d):
    print('a=', a)
    print('b=', b)
    print('c=', c)
    print('d=', d)


# 下面的调用会报错
# fun4(10, 20, 30, 40)
fun4(10, 20, c=30, d=40)
